//
// Created by TNJ on 2021/6/7.
//

#ifndef DLIST_DLIST_H
#define DLIST_DLIST_H

typedef struct dlist{
    int data;
    struct dlist *next;
    struct dlist *prev;
}dlist_t;

extern dlist_t *new_dlist_node(int data);  //新建一个结点
extern dlist_t *dlist_add(dlist_t *list, int data);  //插入一个结点
extern dlist_t *dlist_delete(dlist_t *list, int index);  //删除索引对应的结点（索引从0开始）
extern dlist_t *dlist_index_of(dlist_t *list, int index);  //查找索引对应的结点
extern void dlist_destroy(dlist_t *list);  //销毁双向循环链表
extern void dlist_print(dlist_t *list);  //打印链表数据

#endif //DLIST_DLIST_H
